package com.example.udpDemo.socket.design.builder;

import java.math.BigDecimal;

/**
 * @author wangdachuan
 * @version 1.0
 * @date 2023/3/31 21:00
 **/
public class PhoneBuilderImpl implements PhoneBuilder{

    private Phone phone;


    public PhoneBuilderImpl() {
        this.phone = new Phone();
    }


    @Override
    public void buildBrand(String brand) {
        phone.setBrand(brand);
    }

    @Override
    public void buildModel(String model) {
        phone.setModel(model);
    }

    @Override
    public void buildMemory(int memory) {
        phone.setMemory(memory);
    }

    @Override
    public void buildPrice(BigDecimal price) {
        phone.setPrice(price);
    }

    @Override
    public Phone getPhone() {
        return phone;
    }
}
